package com.yuand.mapper;

import com.yuand.entity.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author yuandong
 * @since 2022-01-15
 */
@Repository
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    /**
     * 查询菜单表所有记录
     * @return
     */
    List<SysMenu> selectMenuList(SysMenu menu);

    /**
     * 根据用户id查询该用户对应的菜单权限
     * @param menu
     * @return
     */
    List<SysMenu> selectMenusByUserId(SysMenu menu);

    /**
     * 收集用户菜单权限perms
     * @param userId
     * @return
     */
    List<String> selectMenuPermsByUserId(Long userId);

}
